﻿Imports System.Data
Partial Class Default2
    Inherits System.Web.UI.Page
    Dim ocnEgresado As New Negocio.Egresado
    Dim ocnInstitucion As New Negocio.Institucion

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Try
            ocnEgresado.RegistrarInfoAcad(Me.TBalumno.Text, Me.TBinstitucion.Text, Me.TBtitulo.Text, Me.TBfecha.Text)
        Catch ex As Exception
            Session.Add("Error", ex.Message)
            Response.Redirect("ManejarErrores.aspx")
        End Try
    End Sub


    Protected Sub TBinstitucion_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles TBinstitucion.Init
        Dim ds As New DataSet
        ds = ocnInstitucion.obtenerListaInstituciones()

        With Me.TBinstitucion
            .DataSource = ds.Tables("Instituciones").DefaultView
            .DataTextField = "nombreInstitucion"
            .DataValueField = "nombreInstitucion"
        End With
        Me.TBinstitucion.DataBind()
    End Sub


End Class
